-- card: 32604 from stack: in.5 -- bmap block id: 6623 -- flags: 0000 -- background id: 3858 -- name: PlotFinderICN ----- HyperTalk script ----- on HideObjects hide cd fld "label 1" hide cd fld "label 2" hide cd btn "Try It!" ClearCardArt end HideObjects on ShowObjects show cd fld "label 1" show cd fld "label 2" show cd btn "Try It!" end ShowObjects on ClearCardArt choose Select Tool drag from 70,130 to 220,285 doMenu "clear picture" choose browse tool end ClearCardArt -- part 1 (button) -- low flags: 00 -- high flags: A002 -- rect: left=82 top=300 right=334 bottom=175 -- title width / last selected line: 0 -- icon id / first selected line: 0 / 0 -- text alignment: 1 -- font id: 0 -- text size: 12 -- style flags: 8192 -- line height: 16 -- part name: Try it! ----- HyperTalk script ----- on mouseUp global errGlobal put FilePath("", "Choose a file please.") into fileName if fileName = empty then exit mouseUp put char 1 to OffSet(":", fileName) of fileName into volName put FileCreator(fileName, "nodialog:errGlobal") into fCreator if errGlobal ≠ empty then answer "Error: “" & errGlobal & "”" put empty into errGlobal exit mouseUp end if put FileType(fileName, "nodialog:errGlobal") into fType if errGlobal ≠ empty then answer errGlobal put empty into errGlobal exit mouseUp end if ClearCardArt repeat with rowNdx = 1 to 3 repeat with colNdx = 0 to 1 put 80 + (rowNdx * 53) into Y put 80 + (colNdx * 85) into X put X & "," & Y into destPt put rowNdx * 2 - 1 + colNdx into theMode DsktpICN fCreator,fType,destPt,theMode,volName,"nodialog:errGlobal" -- PlotFinderICN fCreator,fType,destPt,theMode,volName,"nodialog:errGlobal" if errGlobal ≠ empty then answer errGlobal put empty into errGlobal end if end repeat -- columns end repeat -- rows end mouseUp -- part 8 (field) -- low flags: 00 -- high flags: 0000 -- rect: left=24 top=116 right=131 bottom=244 -- title width / last selected line: 0 -- icon id / first selected line: 0 / 0 -- text alignment: 0 -- font id: 3 -- text size: 9 -- style flags: 0 -- line height: 12 -- part name: label 1 -- part 9 (field) -- low flags: 00 -- high flags: 0000 -- rect: left=2 top=135 right=293 bottom=71 -- title width / last selected line: 0 -- icon id / first selected line: 0 / 0 -- text alignment: 65535 -- font id: 3 -- text size: 9 -- style flags: 0 -- line height: 11 -- part name: label 2 -- part contents for background part 38 ----- text ----- 35/50 -- part contents for background part 20 ----- text ----- This XCMD draws a file's ICN# onto the card (an ICN# is the icon that the Finder displays when using "view by icon"). Calling syntax : DsktpICN Creator,Type,«DestPt»,«ICNstate»,«volumeName», «nodialog:globalVar» CREATOR: a four character file creator signature TYPE: a four character file type signature «DESTPT»: optional, the upper left corner of the drawing. Default value is 0,0. «ICNSTATE»: optional, a number specifying the state of the ICN. Possible value are: 1: non-open,non-selected, online 2: non-open,selected, online 3: non-open,non-selected, offline 4: non-open,selected, offline 5: open,non-selected, online/offline 6: open,selected, online/offline Because HyperCard uses so many screen buffers, we can not draw directly to HC's grafPort since our image would probably be erased very quickly. Thus we convert the ICN into a Picture, copy it to the clipboard, and then paste it onto the card. This causes whatever was in the clipboard before calling the XCMD to be lost. BEWARE: This XCMD uses the invisible desktop file to retrieve the icons it needs. While there is nothing inherently dangerous in doing this, things will change with System 7.0. The Desktop Manager (currently used by Appleshare file servers) does not use a desktop file and so you will probably get generic icons whenever you call this XCMD and Desktop Manager is running. COMING SOON: A desktop manager compatible version! -- part contents for card part 8 ----- text ----- unselected selected -- part contents for card part 9 ----- text ----- non-open online non-open offline open online/offline